package cn.uestc.labhms.modules.hms.dao;

import cn.uestc.labhms.modules.hms.entity.HmsChiEngEntity;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface HmsChiEngDao extends BaseMapper<HmsChiEngEntity> {
    @Select("select distinct table_name_eng from hms_Chi_Eng where table_name_chi = #{tableNameC};")
    String getTableNameC2E(String tableNameC);
    @Select("select distinct table_name_chi from hms_Chi_Eng where table_name_eng = #{tableNameE};")
    String getTableNameE2C(String tableNameE);
    @Select("select distinct eng_field from hms_Chi_Eng where table_name_chi = #{tableNameC} and chi_field = #{fieldC};")
    String getFieldC2E(String tableNameC, String fieldC);
    @Select("select distinct chi_field from hms_Chi_Eng")
    List<String> getDistinctFieldC();
    @Select("select distinct eng_field from hms_Chi_Eng")
    List<String> getDistinctFieldE();
    @Select("select distinct chi_field from hms_Chi_Eng where table_name_eng = #{tableNameE} and eng_field = #{fieldE};")
    String getFieldE2C(String tableNameE, String fieldE);
    @Select("select distinct table_name_chi from hms_Chi_Eng")
    List<String> getTableNamesCH();
    @Select("select distinct table_name_eng from hms_Chi_Eng")
    List<String> getTableNamesEN();
    @Select("select distinct chi_field from hms_Chi_Eng where eng_field = #{fieldE} limit 1")
    String getDistinctFieldE2C(String fieldE);
}
